#include <stdio.h>
#include <string.h>
#include <stdlib.h>


//typedef struct _stu
//{
//    char name[30];
//    int score;

//}Stu;

typedef struct _stu
{
    char *name;
    int score;

}Stu;

// 申请空间的时候，从外至内，
// 释放空间的时候，从内至外。

int main()
{
    Stu *ps = (Stu *)malloc(sizeof (Stu));
    ps -> name = (char*)malloc(100);
    strcpy(ps ->name,"JimGreen");
    ps ->score = 99;

    printf("name = %s score = %d\n",ps -> name,ps -> score);
    free(ps->name);
    free(ps);
    return 0;
}
